package com.litchi.Controllers;

import com.litchi.Repository.ProjectRepository;
import org.springframework.beans.factory.annotation.Autowired;
import com.litchi.Ultis.Result;
import org.springframework.web.bind.annotation.*;

@RestController
public class ProjectController {

    @Autowired
    ProjectRepository projectRepository;

    @GetMapping(value = "/project")
    public Result getProject() {

        return Result.success(projectRepository.findInner());
    }


    @GetMapping(value = "/projectOne")
    public Result getProjectOne() {

        return Result.success(projectRepository.findByUserId(1));
    }

    @GetMapping(value = "/searchProject")
    public Result searchProject() {

        return Result.success(projectRepository.findByUserId(1));
    }
}
